﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.ApplicationBlocks.Data;
using System.Data;
using System.Data.SqlClient;

namespace MyTemplate
{
    public class User
    {
        public int GetUserByIdFromUserName(string userID, string PW)
        {
            object obj2 = SqlHelper.ExecuteScalar(SqlHelper.DbConnectionString, CommandType.StoredProcedure,
                "spGetUserByUserIDPW",
                new SqlParameter[] { new SqlParameter("@UserID", userID), new SqlParameter("@PW", PW) });
            if ((obj2 != null) && (obj2 != DBNull.Value))
            {
                return int.Parse(obj2.ToString());
            }
            return -1;
        }
    }
}